
import { Request } from "@/util/request.js"

//获取接口的公共的配置文件

//登录接口
export const login = (obj, data) => Request.getData({
    url: `/api/user/login.do?username=${obj.username}&password=${obj.password}`,
    method: "post",
    // data
})



//首页接口
export const HomeRight = (obj, data) => Request.getData({
    url: `/api/product/list.do?pageNum=${obj.pageNum}&pageSize=${obj.pageSize}`,
    method: "post",
    // data:obj
})

//用户接口
export const UserList = (obj, data) => Request.getData({
    url: `/api/user/list.do?pageNum=${obj.pageNum}&pageSize=${obj.pageSize}`,
    method: "post",
    // data:obj
})

//商品接口搜索id$productName=${obj.productName}
export const ListSeach = (obj, data) => Request.getData({
    url: `/api/product/search.do?productId=${obj.productId}`,
    method: "post",
    data: obj
})
//商品接口搜索name
export const ListSeached = (obj, data) => Request.getData({
    url: `/api/product/search.do?productName=${obj.productName}`,
    method: "post",
    data: obj
})

//品类接口
export const Category = (obj, data) => Request.getData({
    url: `/api/category/get_category.do`,
    method: "post",
    data: obj
})

//订单接口
export const OrderList = (obj, data) => Request.getData({
    url: `/api/order/list.do?pageNum=${obj.pageNum}&pageSize=${obj.pageSize}`,
    method: "post",
    data: obj
})

//首页接口
export const Detail = (obj, data) => Request.getData({
    url: `/api/product/detail.do?productId=${obj.productId}`,
    method: "post",
    data:obj
})

//商品修改接口
export const addDetail = (obj, data) => Request.getData({
    url: `/api/product/detail.do?categoryId=${obj.categoryId}&name=${obj.name}&subtitle=${obj.subtitle}&subImages=${obj.subImages}&detail=${obj.detail}&price=${obj.price}&stock=${obj.stock}&status=${obj.status}&id=${obj.id}`,
    method: "post",
    data:obj
})
